package com.dianrui.operation.activity;

import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;


import com.dianrui.operation.R;

import butterknife.BindView;
import butterknife.OnClick;

public class AuthInfoActivity extends BaseActivity{
    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.name)
   TextView name;
    @BindView(R.id.card)
   TextView card;
    @BindView(R.id.account)
    TextView account;


    @Override
    public int getContentViewId() {
        return R.layout.auth_info;
    }

    @Override
    public void initView() {
        title.setText(getString(R.string.account_info));
        name.setText(spUtils.getString("nickname"));
        account.setText(spUtils.getString("account"));
        if(!TextUtils.isEmpty(spUtils.getString("mobile")) && spUtils.getString("mobile").length() > 6 ){
            StringBuilder sb  =new StringBuilder();
            for (int i = 0; i < spUtils.getString("mobile").length(); i++) {
                char c = spUtils.getString("mobile").charAt(i);
                if (i >= 3 && i <= 6) {
                    sb.append('*');
                } else {
                    sb.append(c);
                }
            }
            card.setText(sb.toString());
        }

    }

    @Override
    public void initData() {}

    @OnClick({R.id.back})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;

                default:
                    break;

        }
    }

}
